import { axios } from '@/service/service'

export function getUserMenusReq(): any {
  return axios({
    url: '/api-user/menus/current',
    method: 'get'
  })
}

export function getAllMenusReq(): any {
  return axios({
    url: '/api-user/menus/findAlls',
    method: 'get'
  })
}

export function delMenuReq(id: number): any {
  return axios({
    url: `/api-user/menus/delete/${id}`,
    method: 'get'
  })
}

export function grantRoleReq(params: any): any {
  return axios({
    url: '/api-user/menus/granted',
    method: 'get',
    params
  })
}

export function addOrUpdateMenuReq(data: any): any {
  return axios({
    url: '/api-user/menus/saveOrUpdate',
    method: 'post',
    data
  })
}

export function getMenuRoles(params: any): any {
  return axios({
    url: '/api-user/menus/findMenuRoles',
    method: 'get',
    params
  })
}
